import IO.Output;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import static org.junit.Assert.*;

/**
 * Created by:
 * User: Igor Martynovich and Guzenko Igor
 * Date: 20.11.13
 */
public class TestOutput {
    private final ByteArrayOutputStream outContent = new ByteArrayOutputStream();

    @Before
    public void setUpStreams() {
        System.setOut(new PrintStream(outContent));

    }

    @Test
    public void testPrintLineMsg(){
        Output.printLineMsg("testMsg");
        assertEquals("\ntestMsg", outContent.toString());
    }

    @After
    public void cleanUpStreams() {
        System.setOut(null);
    }
}
